

<!DOCTYPE html>
<html class="writer-html5" lang="en" >
<head>
  <meta charset="utf-8" />
  
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
  
  <title>mindspore.nn.probability.distribution.Distribution &mdash; MindSpore master documentation</title>
  

  
  <link rel="stylesheet" href="../../_static/css/theme.css" type="text/css" />
  <link rel="stylesheet" href="../../_static/pygments.css" type="text/css" />

  
  

  
  

  

  
  <!--[if lt IE 9]>
    <script src="../../_static/js/html5shiv.min.js"></script>
  <![endif]-->
  
    
      <script type="text/javascript" id="documentation_options" data-url_root="../../" src="../../_static/documentation_options.js"></script>
        <script src="../../_static/jquery.js"></script>
        <script src="../../_static/underscore.js"></script>
        <script src="../../_static/doctools.js"></script>
        <script src="../../_static/language_data.js"></script>
        <script async="async" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.5/latest.js?config=TeX-AMS-MML_HTMLorMML"></script>
    
    <script type="text/javascript" src="../../_static/js/theme.js"></script>

    
    <link rel="index" title="Index" href="../../genindex.html" />
    <link rel="search" title="Search" href="../../search.html" />
    <link rel="next" title="mindspore.nn.probability.distribution.Exponential" href="mindspore.nn.probability.distribution.Exponential.html" />
    <link rel="prev" title="mindspore.nn.probability.distribution.Cauchy" href="mindspore.nn.probability.distribution.Cauchy.html" /> 
</head>

<body class="wy-body-for-nav">

   
  <div class="wy-grid-for-nav">
    
    <nav data-toggle="wy-nav-shift" class="wy-nav-side">
      <div class="wy-side-scroll">
        <div class="wy-side-nav-search" >
          

          
            <a href="../../index.html" class="icon icon-home"> MindSpore
          

          
          </a>

          
            
            
          

          
<div role="search">
  <form id="rtd-search-form" class="wy-form" action="../../search.html" method="get">
    <input type="text" name="q" placeholder="Search docs" />
    <input type="hidden" name="check_keywords" value="yes" />
    <input type="hidden" name="area" value="default" />
  </form>
</div>

          
        </div>

        
        <div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
          
            
            
              
            
            
              <p class="caption"><span class="caption-text">MindSpore Python API</span></p>
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="../mindspore.html">mindspore</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.common.initializer.html">mindspore.common.initializer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.communication.html">mindspore.communication</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.compression.html">mindspore.compression</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.context.html">mindspore.context</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.html">mindspore.dataset</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.audio.html">mindspore.dataset.audio</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.config.html">mindspore.dataset.config</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.text.html">mindspore.dataset.text</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.transforms.html">mindspore.dataset.transforms</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.dataset.vision.html">mindspore.dataset.vision</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.mindrecord.html">mindspore.mindrecord</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.nn.html">mindspore.nn</a></li>
<li class="toctree-l1 current"><a class="reference internal" href="../mindspore.nn.probability.html">mindspore.nn.probability</a><ul class="current">
<li class="toctree-l2"><a class="reference internal" href="../mindspore.nn.probability.html#bijectors">Bijectors</a></li>
<li class="toctree-l2 current"><a class="reference internal" href="../mindspore.nn.probability.html#distributions">Distributions</a><ul class="current">
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Bernoulli.html">mindspore.nn.probability.distribution.Bernoulli</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Beta.html">mindspore.nn.probability.distribution.Beta</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Categorical.html">mindspore.nn.probability.distribution.Categorical</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Cauchy.html">mindspore.nn.probability.distribution.Cauchy</a></li>
<li class="toctree-l3 current"><a class="current reference internal" href="#">mindspore.nn.probability.distribution.Distribution</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Exponential.html">mindspore.nn.probability.distribution.Exponential</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Gamma.html">mindspore.nn.probability.distribution.Gamma</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Geometric.html">mindspore.nn.probability.distribution.Geometric</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Gumbel.html">mindspore.nn.probability.distribution.Gumbel</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Logistic.html">mindspore.nn.probability.distribution.Logistic</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.LogNormal.html">mindspore.nn.probability.distribution.LogNormal</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Normal.html">mindspore.nn.probability.distribution.Normal</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Poisson.html">mindspore.nn.probability.distribution.Poisson</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.TransformedDistribution.html">mindspore.nn.probability.distribution.TransformedDistribution</a></li>
<li class="toctree-l3"><a class="reference internal" href="mindspore.nn.probability.distribution.Uniform.html">mindspore.nn.probability.distribution.Uniform</a></li>
</ul>
</li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.nn.transformer.html">mindspore.nn.transformer</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.numpy.html">mindspore.numpy</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.ops.html">mindspore.ops</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.parallel.html">mindspore.parallel</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.parallel.nn.html">mindspore.parallel.nn</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.profiler.html">mindspore.profiler</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.scipy.html">mindspore.scipy</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.train.html">mindspore.train</a></li>
<li class="toctree-l1"><a class="reference internal" href="../mindspore.boost.html">mindspore.boost</a></li>
</ul>
<p class="caption"><span class="caption-text">MindSpore C++ API</span></p>
<ul>
<li class="toctree-l1"><a class="reference external" href="https://www.mindspore.cn/lite/api/zh-CN/master/api_cpp/mindspore.html">MindSpore Lite↗</a></li>
</ul>

            
          
        </div>
        
      </div>
    </nav>

    <section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">

      
      <nav class="wy-nav-top" aria-label="top navigation">
        
          <i data-toggle="wy-nav-top" class="fa fa-bars"></i>
          <a href="../../index.html">MindSpore</a>
        
      </nav>


      <div class="wy-nav-content">
        
        <div class="rst-content">
        
          

















<div role="navigation" aria-label="breadcrumbs navigation">

  <ul class="wy-breadcrumbs">
    
      <li><a href="../../index.html" class="icon icon-home"></a> &raquo;</li>
        
          <li><a href="../mindspore.nn.probability.html">mindspore.nn.probability</a> &raquo;</li>
        
      <li>mindspore.nn.probability.distribution.Distribution</li>
    
    
      <li class="wy-breadcrumbs-aside">
        
          
            <a href="../../_sources/api_python/nn_probability/mindspore.nn.probability.distribution.Distribution.rst.txt" rel="nofollow"> View page source</a>
          
        
      </li>
    
  </ul>

  
  <hr/>
</div>
          <div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
           <div itemprop="articleBody">
            
  <div class="section" id="mindspore-nn-probability-distribution-distribution">
<h1>mindspore.nn.probability.distribution.Distribution<a class="headerlink" href="#mindspore-nn-probability-distribution-distribution" title="Permalink to this headline">¶</a></h1>
<dl class="class">
<dt id="mindspore.nn.probability.distribution.Distribution">
<em class="property">class </em><code class="sig-prename descclassname">mindspore.nn.probability.distribution.</code><code class="sig-name descname">Distribution</code><span class="sig-paren">(</span><em class="sig-param">seed</em>, <em class="sig-param">dtype</em>, <em class="sig-param">name</em>, <em class="sig-param">param</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution" title="Permalink to this definition">¶</a></dt>
<dd><p>所有分布的基类。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>seed</strong> (int) - 采样时使用的种子。如果为None，则使用0。</p></li>
<li><p><strong>dtype</strong> (mindspore.dtype) - 事件样例的类型。</p></li>
<li><p><strong>name</strong> (str) - 分布的名称。</p></li>
<li><p><strong>param</strong> (dict) - 用于初始化分布的参数。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>派生类必须重写 <cite>_mean</cite> 、 <cite>_prob</cite> 和 <cite>_log_prob</cite> 等操作。必填参数必须通过 <cite>args</cite> 或 <cite>kwargs</cite> 传入，如 <cite>_prob</cite> 的 <cite>value</cite> 。</p>
</div>
<p><strong>支持平台：</strong></p>
<p><code class="docutils literal notranslate"><span class="pre">Ascend</span></code> <code class="docutils literal notranslate"><span class="pre">GPU</span></code></p>
<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.cdf">
<code class="sig-name descname">cdf</code><span class="sig-paren">(</span><em class="sig-param">value</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.cdf" title="Permalink to this definition">¶</a></dt>
<dd><p>在给定值下计算累积分布函数（Cumulatuve Distribution Function, CDF）。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>value</strong> (Tensor) - 要计算的值。</p></li>
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 累积分布函数的值。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.construct">
<code class="sig-name descname">construct</code><span class="sig-paren">(</span><em class="sig-param">name</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.construct" title="Permalink to this definition">¶</a></dt>
<dd><p>重写Cell中的 <cite>construct</cite> 。</p>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>支持的函数包括：’prob’、’log_prob’、’cdf’, ‘log_cdf’、’survival_function’、’log_survival’、’var’、
‘sd’、’mode’、’mean’、’entropy’、’kl_loss’、’cross_entropy’、’sample’、’get_dist_args’、’get_dist_type’。</p>
</div>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>name</strong> (str) - 函数名称。</p></li>
<li><p><strong>args</strong> (list) - 函数所需的位置参数列表。</p></li>
<li><p><strong>kwargs</strong> (dict) - 函数所需的关键字参数字典。</p></li>
</ul>
<p><strong>返回：</strong></p>
<p>Tensor, name对应函数的值。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.cross_entropy">
<code class="sig-name descname">cross_entropy</code><span class="sig-paren">(</span><em class="sig-param">dist</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.cross_entropy" title="Permalink to this definition">¶</a></dt>
<dd><p>计算分布a和b之间的交叉熵。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>dist</strong> (str) - 分布的类型。</p></li>
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Distribution b的 <cite>dist_spec_args</cite> 必须通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递给函数。 传入Distribution a的 <cite>dist_spec_args</cite> 是可选的。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 交叉熵的值。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.entropy">
<code class="sig-name descname">entropy</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.entropy" title="Permalink to this definition">¶</a></dt>
<dd><p>计算熵。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 熵的值。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.get_dist_args">
<code class="sig-name descname">get_dist_args</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.get_dist_args" title="Permalink to this definition">¶</a></dt>
<dd><p>返回分布的参数列表。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>传递给字类的参数的顺序应该与通过 <cite>_add_parameter</cite> 初始化默认参数的顺序相同。</p>
</div>
<p><strong>返回：</strong></p>
<p>list[Tensor], 参数列表。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.get_dist_type">
<code class="sig-name descname">get_dist_type</code><span class="sig-paren">(</span><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.get_dist_type" title="Permalink to this definition">¶</a></dt>
<dd><p>返回分布类型。</p>
<p><strong>返回：</strong></p>
<p>string, 分布类型名字。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.kl_loss">
<code class="sig-name descname">kl_loss</code><span class="sig-paren">(</span><em class="sig-param">dist</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.kl_loss" title="Permalink to this definition">¶</a></dt>
<dd><p>计算KL散度，即KL(a||b)。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>dist</strong> (str) - 分布的类型。</p></li>
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>Distribution b的 <cite>dist_spec_args</cite> 必须通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递给函数。 传入Distribution a的 <cite>dist_spec_args</cite> 是可选的。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, KL散度。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.log_cdf">
<code class="sig-name descname">log_cdf</code><span class="sig-paren">(</span><em class="sig-param">value</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.log_cdf" title="Permalink to this definition">¶</a></dt>
<dd><p>计算给定值对于的累积分布函数的对数。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>value</strong> (Tensor) - 要计算的值。</p></li>
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 累积分布函数的对数。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.log_prob">
<code class="sig-name descname">log_prob</code><span class="sig-paren">(</span><em class="sig-param">value</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.log_prob" title="Permalink to this definition">¶</a></dt>
<dd><p>计算给定值对应的概率的对数（pdf或pmf）。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>value</strong> (Tensor) - 要计算的值。</p></li>
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 累积分布函数的对数。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.log_survival">
<code class="sig-name descname">log_survival</code><span class="sig-paren">(</span><em class="sig-param">value</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.log_survival" title="Permalink to this definition">¶</a></dt>
<dd><p>计算给定值对应的生存函数的对数。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>value</strong> (Tensor) - 要计算的值。</p></li>
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 生存函数的对数。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.mean">
<code class="sig-name descname">mean</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.mean" title="Permalink to this definition">¶</a></dt>
<dd><p>计算期望。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 概率分布的期望。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.mode">
<code class="sig-name descname">mode</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.mode" title="Permalink to this definition">¶</a></dt>
<dd><p>计算众数。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 概率分布的众数。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.prob">
<code class="sig-name descname">prob</code><span class="sig-paren">(</span><em class="sig-param">value</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.prob" title="Permalink to this definition">¶</a></dt>
<dd><p>计算给定值下的概率。对于离散分布是计算概率质量函数（Probability Mass Function），而对于连续分布是计算概率密度函数（Probability Density Function）。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>value</strong> (Tensor) - 要计算的值。</p></li>
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 概率值。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.sample">
<code class="sig-name descname">sample</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.sample" title="Permalink to this definition">¶</a></dt>
<dd><p>采样函数。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>shape</strong> (tuple) - 样本的shape。</p></li>
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 根据概率分布采样的样本。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.sd">
<code class="sig-name descname">sd</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.sd" title="Permalink to this definition">¶</a></dt>
<dd><p>计算标准差。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 概率分布的标准差。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.survival_function">
<code class="sig-name descname">survival_function</code><span class="sig-paren">(</span><em class="sig-param">value</em>, <em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.survival_function" title="Permalink to this definition">¶</a></dt>
<dd><p>计算给定值对应的生存函数。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>value</strong> (Tensor) - 要计算的值。</p></li>
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 生存函数的值。</p>
</dd></dl>

<dl class="method">
<dt id="mindspore.nn.probability.distribution.Distribution.var">
<code class="sig-name descname">var</code><span class="sig-paren">(</span><em class="sig-param">*args</em>, <em class="sig-param">**kwargs</em><span class="sig-paren">)</span><a class="headerlink" href="#mindspore.nn.probability.distribution.Distribution.var" title="Permalink to this definition">¶</a></dt>
<dd><p>计算方差。</p>
<p><strong>参数：</strong></p>
<ul class="simple">
<li><p><strong>args</strong> (list) - 位置参数列表，具体需要的参数根据子类的实现确定。。</p></li>
<li><p><strong>kwargs</strong> (dict) - 关键字参数字典，具体需要的参数根据子类的实现确定。</p></li>
</ul>
<div class="admonition note">
<p class="admonition-title">Note</p>
<p>可以通过 <cite>args</cite> 或 <cite>kwargs</cite> 传递其 <cite>dist_spec_args</cite> 来选择性地将Distribution传递给函数。</p>
</div>
<p><strong>返回：</strong></p>
<p>Tensor, 概率分布的方差。</p>
</dd></dl>

</dd></dl>

</div>


           </div>
           
          </div>
          <footer>
    <div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
        <a href="mindspore.nn.probability.distribution.Exponential.html" class="btn btn-neutral float-right" title="mindspore.nn.probability.distribution.Exponential" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right" aria-hidden="true"></span></a>
        <a href="mindspore.nn.probability.distribution.Cauchy.html" class="btn btn-neutral float-left" title="mindspore.nn.probability.distribution.Cauchy" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left" aria-hidden="true"></span> Previous</a>
    </div>

  <hr/>

  <div role="contentinfo">
    <p>
        &#169; Copyright 2021, MindSpore.

    </p>
  </div>
    
    
    
    Built with <a href="https://www.sphinx-doc.org/">Sphinx</a> using a
    
    <a href="https://github.com/readthedocs/sphinx_rtd_theme">theme</a>
    
    provided by <a href="https://readthedocs.org">Read the Docs</a>. 

</footer>
        </div>
      </div>

    </section>

  </div>
  

  <script type="text/javascript">
      jQuery(function () {
          SphinxRtdTheme.Navigation.enable(true);
      });
  </script>

  
  
    
   

</body>
</html>